﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using edu.Model;

namespace edu.Web
{
    public class BasePage : Page
    {
        /// <summary>
        /// 检查登录
        /// </summary>
        protected void IsLogin()
        {
            //未登录跳转到登陆界面
            //if (UserInfo == null)
            //    Response.Redirect("~/");
        }

        /// <summary>
        /// 判断权限
        /// </summary>
        protected void HasPermission()
        {

        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            IsLogin();
            HasPermission();
        }

        public User UserInfo
        {
            get
            {
                //return Session["User"] == null ? null : (User)Session["User"];
                return new User { Id = 1, UserName = "admin" };//模拟登录
            }
        }
    }
}